﻿<phone:PhoneApplicationPage 
    x:Class="WeiboPlus.Shell.Views.SettingView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:cvt="clr-namespace:WeiboPlus.Converter;assembly=WeiboPlus.Common"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="LightGray"
    SupportedOrientations="PortraitOrLandscape"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">
    <!--xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
     xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"-->
    <phone:PhoneApplicationPage.Resources>
        <cvt:Int2EnumConverter x:Key="Int2EnumConverter" />
    </phone:PhoneApplicationPage.Resources>
    <Grid x:Name="LayoutRoot" Background="{StaticResource BackroundBrush}" >
        <controls:Pivot  x:Name="pivot"  Margin="0,0,0,70" Foreground="LightGray" SelectedIndex="{Binding PivotSelectedIndex,Mode=TwoWay}">
        <controls:PivotItem Header="{Binding SettingBasicText, Source={StaticResource AppResx}}">
            <Grid Grid.Row="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                <StackPanel Margin="4" Grid.Row="0" HorizontalAlignment="Stretch" Orientation="Vertical">
                    <TextBlock TextWrapping="Wrap" FontSize="{StaticResource PhoneFontSizeSmall}" FontFamily="{StaticResource PhoneFontFamilyNormal}" LineHeight="22"
                            LineStackingStrategy="BlockLineHeight" Foreground="LightGray" Text="{Binding DisplayLangText, Source={StaticResource AppResx}}" Margin="12,0,0,0" />
                    <toolkit:ListPicker ItemsSource="{Binding SupportedLanguages}" DisplayMemberPath="NativeName" ExpansionMode="ExpansionAllowed"
                            Style="{StaticResource ListPickerStyle}" SelectedItem="{Binding Language,Mode=TwoWay}" >
                            <toolkit:ListPicker.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Vertical" Background="LightYellow"></StackPanel>
                                </ItemsPanelTemplate>
                            </toolkit:ListPicker.ItemsPanel>
                        </toolkit:ListPicker>
                </StackPanel>

                <StackPanel Margin="4" Grid.Row="1">
                    <TextBlock TextWrapping="Wrap" FontSize="{StaticResource PhoneFontSizeSmall}" FontFamily="{StaticResource PhoneFontFamilyNormal}" LineHeight="22"
                            LineStackingStrategy="BlockLineHeight" Foreground="LightGray" Text="{Binding ThemeText, Source={StaticResource AppResx}}" Margin="12,0,0,0" />
                        <toolkit:ListPicker ItemsSource="{Binding SupportedThemes}" DisplayMemberPath="Value" ExpansionMode="ExpansionAllowed" Style="{StaticResource ListPickerStyle}"
                            SelectedItem="{Binding ThemeItem,Mode=TwoWay}" >
                            <toolkit:ListPicker.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Vertical" Background="LightYellow"></StackPanel>
                                </ItemsPanelTemplate>
                            </toolkit:ListPicker.ItemsPanel>
                        </toolkit:ListPicker>
                </StackPanel>
                    <CheckBox Style="{StaticResource CheckBoxStyle1}" x:Name="cbOrientation" Foreground="LightGray" Grid.Row="2" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="4" Content="{Binding EnableOriChangeText, Source={StaticResource AppResx}}" Checked="CheckBox_Checked" Unchecked="CheckBox_UnChecked" IsChecked="{Binding Item.EnableOrientationChange,Mode=TwoWay}" />
            </Grid>
        </controls:PivotItem>
        <controls:PivotItem Header="{Binding SettingAdvanceText, Source={StaticResource AppResx}}">
                    <Grid Grid.Row="1">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <StackPanel Margin="4" Grid.Row="0" HorizontalAlignment="Stretch" Orientation="Vertical">
                            <TextBlock TextWrapping="Wrap" Foreground="LightGray" Text="{Binding UpdateIntervalText, Source={StaticResource AppResx}}" Margin="12,0,0,0" />
                        <toolkit:ListPicker ItemsSource="{Binding Intervals}" Style="{StaticResource ListPickerStyle}" SelectedItem="{Binding Item.QueryNewInterval,Mode=TwoWay}" >
                            <toolkit:ListPicker.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Vertical" Background="LightYellow"></StackPanel>
                                </ItemsPanelTemplate>
                            </toolkit:ListPicker.ItemsPanel>
                        </toolkit:ListPicker>
                    </StackPanel>

                        <StackPanel Margin="4" Grid.Row="1">
                            <TextBlock TextWrapping="Wrap" Foreground="LightGray" Text="{Binding PageSizeText, Source={StaticResource AppResx}}" Margin="12,0,0,0" />
                            <toolkit:ListPicker ItemsSource="{Binding PageCounts}" Style="{StaticResource ListPickerStyle}" ExpansionMode="ExpansionAllowed"
                            SelectedItem="{Binding Item.PageCount,Mode=TwoWay}" >
                            <toolkit:ListPicker.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Vertical" Background="LightYellow"></StackPanel>
                                </ItemsPanelTemplate>
                            </toolkit:ListPicker.ItemsPanel>
                        </toolkit:ListPicker>
                        </StackPanel>

                        <StackPanel Margin="4" Grid.Row="2">
                            <TextBlock TextWrapping="Wrap" FontSize="{StaticResource PhoneFontSizeSmall}" FontFamily="{StaticResource PhoneFontFamilyNormal}" LineHeight="22"
                            LineStackingStrategy="BlockLineHeight" Foreground="LightGray" Text="{Binding PixResolutionText, Source={StaticResource AppResx}}" Margin="12,0,0,0" />
                            <toolkit:ListPicker ItemsSource="{Binding ImageResolutions}" ExpansionMode="ExpansionAllowed" Style="{StaticResource ListPickerStyle}"
                            SelectedItem="{Binding Item.UploadImageResolution,Mode=TwoWay}" FullModeHeader="{Binding PixResolutionText, Source={StaticResource AppResx}}"
                            FullModeItemTemplate="{StaticResource ImageResolutionPickerItemTemplate}" ItemTemplate="{StaticResource ImageResolutionPickerItemTemplate}">
                            
                            <toolkit:ListPicker.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Vertical" Background="LightYellow"></StackPanel>
                                </ItemsPanelTemplate>
                            </toolkit:ListPicker.ItemsPanel>
                
                        </toolkit:ListPicker>
                        </StackPanel>

                        <StackPanel Margin="4" Grid.Row="3">
                            <TextBlock TextWrapping="Wrap" FontSize="{StaticResource PhoneFontSizeSmall}" FontFamily="{StaticResource PhoneFontFamilyNormal}" LineHeight="22"
                            LineStackingStrategy="BlockLineHeight" Foreground="LightGray" Text="{Binding PixQualityText, Source={StaticResource AppResx}}" Margin="12,0,0,0" />
                            <toolkit:ListPicker ItemsSource="{Binding ImageQualityTexts}" ExpansionMode="ExpansionAllowed" Style="{StaticResource ListPickerStyle}"
                            SelectedIndex="{Binding Item.ImageQuality,Mode=TwoWay, Converter={StaticResource Int2EnumConverter}}" >
                            <toolkit:ListPicker.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Vertical" Background="LightYellow"></StackPanel>
                                </ItemsPanelTemplate>
                            </toolkit:ListPicker.ItemsPanel>
                        </toolkit:ListPicker>
                        </StackPanel>
                    <CheckBox Style="{StaticResource CheckBoxStyle1}"  Foreground="LightGray" Grid.Row="4" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="4" Content="{Binding ShakeToRefeshText, Source={StaticResource AppResx}}" IsChecked="{Binding Item.EnableShakeToRefresh,Mode=TwoWay}" />
                    
                    </Grid>
        </controls:PivotItem>
    </controls:Pivot>
    </Grid>
        

    <!--Panorama-based applications should not show an ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Opacity=".5">
            <shell:ApplicationBar.Buttons>
                <!--
                <shell:ApplicationBarIconButton x:Name="ok" Click="ok_Click" IconUri="/Images/AppBarIcons/appbar.check.rest.png" Text="{Binding SaveText, Source={StaticResource AppResx}}" />
                <shell:ApplicationBarIconButton x:Name="reset" Click="reset_Click" IconUri="/Images/AppBarIcons/refresh.png" Text="{Binding ResetText, Source={StaticResource AppResx}}"/>
                -->
            </shell:ApplicationBar.Buttons>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>
